package hfkh.io01;

import java.io.*;

public class Code12 {
	public static void main(String[] args) {
		DataInputStream dis=null;
		DataOutputStream dos=null;
		try {
			dis=new DataInputStream(new FileInputStream("e:/1.jpg"));
			dos=new DataOutputStream(new FileOutputStream("e:\\aa\\1.jpg"));
			
			int temp;
			while((temp=dis.read())!=-1){
				dos.write(temp);
			}
		} catch (FileNotFoundException e) {
			
			e.printStackTrace();
		} catch (IOException e) {
			
			e.printStackTrace();
		}finally{
			if(dis!=null){
				try {
					dis.close();
				} catch (IOException e) {
					
					e.printStackTrace();
				}
			}
			if(dos!=null){
				try {
					dos.close();
				} catch (IOException e) {
					
					e.printStackTrace();
				}
			}
		}
	}

}
